<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class AddWorkflowNoToWorkflowOrdersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('workflow_orders', function (Blueprint $table) {
            $table->char('workflowNo', 32)->default('')->comment('工作流编号')->after('name');

            $table->unique('workflowNo', 'idx_workflowNo');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('workflow_orders', function (Blueprint $table) {
            $table->dropColumn('workflowNo');
        });
    }
}
